<extend name="Public/base"/>
<block name="content">
    <div class="row-fluid">
        <form class="form-horizontal" action="{:U()}" method="post">
            <fieldset>
                <legend>{:isset($info['id'])?'编辑':'新增'}科技查新业务</legend>
                <div class="control-group">
                    <label class="control-label" for="wtrname">委托人姓名 </label>
                    <div class="controls">
                        <input type="text" class="span6" id="wtrname"  name="wtrname" value="{$info.wtrname}">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="wtrdw">委托人单位 </label>
                    <div class="controls">
                        <input type="text" class="span6" id="wtrdw"  name="wtdw" value="{$info.wtdw}">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">委托人Email</label>
                    <label class="controls">
                        <input type="text" class="input-xs" name="wtremail" value="{$info.wtremail}">
                    </label>
                </div>
                <div class="control-group">
                    <label class="control-label">联系电话</label>
                    <label class="controls">
                        <input type="text" class="input-xs" name="phone" value="{$info.phone}">
                    </label>
                </div>
                <div class="control-group">
                    <label class="control-label">在线联系方式</label>
                    <label class="controls">
                        <input type="text" class="input-xs" name="zxlx" value="{$info.zxlx}">
                    </label>
                </div>
                <div class="control-group">
                    <label class="control-label">项目名称(中文)</label>
                    <label class="controls">
                        <input type="text" class="input-xs" name="xmmc" value="{$info.xmmc}">
                    </label>
                </div>
                <div class="control-group">
                    <label class="control-label">项目名称（英文）</label>
                    <label class="controls">
                        <input type="text" class="input-xs" name="xmmcen" value="{$info.xmmcen}">
                    </label>
                </div>
                <div class="control-group">
                    <label class="control-label">查新目的</label>
                    <div class="controls">
                        <p>
                            <volist name=":getCxmdCheckbox()" id="vo">
								<in name="key" value="$info['cxmd']">
                                    <input type="checkbox"  name="cxmd[]" value="{$key}" checked />
									<else />
                                    <input type="checkbox" name="cxmd[]" value="{$key}">
								</in>
                                <i></i>{$vo}
                            </volist>
                        </p>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">详细查新目的</label>
                    <div class="controls">
                        <textarea class="custom-scroll" row="3" name="xxcxmd">{$info.xxcxmd}</textarea>
                        <p class="help-block">如“申报国家自然科学基金项目”</p>
                    </div>
                </div>
                <div class="control-group">
                    <labbel class="control-label">查新地域</labbel>
                    <div class="controls">
                        <p>
                            <volist name=":getArea()" id="vo">
                                <eq name="key" value="$info.cxyq">
                                    <input type="radio"  name="cxyq" value="{$key}" checked>
                                    <else/>
                                    <input type="radio" name="cxyq" value="{$key}">
                                </eq> 
                                <i></i> {$vo} 
                            </volist>
                        </p>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">用户来源</label>
                    <div class="controls">
                        <p>
                            <volist name=":getUserSource()" id="vo">
                                <eq name="key" value="$info.wtdwxz">
                                    <input type="radio" checked="checked" name="wtdwxz" value="{$key}">
                                    <else/>
                                    <input type="radio" name="wtdwxz" value="{$key}">
                                </eq>
                                <i></i> {$vo} 
                            </volist>
                        </p>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">学校类型</label>
                    <div class="controls">
                        <select name="xkfl">
                            <option value="">请选择学校类型</option>
                            <volist name=":getSchoolTypeSelect()" id="vo">
                                <eq name="key" value="$info.xkfl">
                                    <option value="{$key}" selected="selected">{$vo}</option>
                                    <else/>
                                    <option value="{$key}">{$vo}</option>
                                </eq>
                            </volist>
                        </select>
                        <i></i>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">项目级别</label>
                    <div class="controls">
                        <p>
                            <volist name=":getLevelRadio()" id="vo">
                                <eq name="key" value="$info.xmjb">
                                    <input type="radio" checked="checked" name="xmjb" value="{$key}">
                                    <else/>
                                    <input type="radio" name="xmjb" value="{$key}">
                                </eq>
                                <i></i> {$vo}
                            </volist>
                        </p>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">期望领取日期</label>
                    <div class="controls">
                        <label class="input" style="width:230px;"> <i class="icon-append fa fa-calendar"></i>
                            <input name="lqrq" value="{$info.lqrq}" type="text" id="date_input" readonly="readonly" onfocus="WdatePicker({onpicked:get_lbg_time,minDate:'%y-%M-{%d}',disabledDates:['2015-07-11','2015-07-12','2015-07-18','2015-07-19','2015-07-25','2015-07-26','2015-08-01','2015-08-02','2015-08-08','2015-08-09','2015-08-15','2015-08-16','2015-08-22','2015-08-23','2015-08-29','2015-08-30','2015-09-05','2015-09-06','2015-09-12','2015-09-13']})" id="datetimepicker">
                        </label>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">是否加急</label>
                    <label class="controls">
                        <input type="hidden" id="sfjj" name="sfjj" value="{$info.sfjj}">
                        <input type="text" id="sfjj_name" value="<if condition="$info.sfjj eq 2"> 不加急 <else /> 加急 </if>" class="input-xs" readonly="readonly">
                    </label>
                </div>
                <div class="control-group">
                    <label class="control-label">付款方式</label>
                    <div class="controls">
                        <p>
                            <volist name=":getPaymentRadio()" id="vo">
                                <eq name="key" value="$info.fkfs">
                                    <input type="radio" checked="checked" name="fkfs" value="{$key}">
                                    <else/>
                                    <input type="radio" name="fkfs" value="{$key}">
                                </eq>
                                <i></i>{$vo}
                            </volist>
                        </p>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">开票单位</label>
                    <div class="controls">
                        <input type="text" class="input-xs" name="kpdw" value="{$info.kpdw}">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">单位税号</label>
                    <div class="controls">
                        <input type="text" class="input-xs" name="dwsh" value="{$info.dwsh}">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">取报告方式</label>
                    <div class="controls">
                        <p>
                            <volist name=":getReportRadio()" id="vo">
                                <eq name="key" value="$info.qbfs">
                                    <input type="radio" checked="checked" name="qbfs" value="{$key}">
                                    <else/>
                                    <input type="radio" name="qbfs" value="{$key}">
                                </eq>
                                <i></i> {$vo}
                            </volist>
                        </p>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">通信地址</label>
                    <div class="controls">
                        <input type="text" class="input-xs" name="txdz" value="{$info.txdz}">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">查看文档</label>
                    <div class="controls input input-file" for="file">
                        <div class="button">
                            <input type="hidden" name="sqfj" id="upload_icoA" value="{$info.sqfj}"/>
                            <input type="file" onchange="ajaxFileUpload_edit('icoA');" id="icoA" name="icoA">
                        </div>
                    </div>
                    <div class="control-label"><a href="#">下载合同</a></div>
                </div>
                <div class="control-group">
                    <label class="control-label">查看文档</label>
                    <div class="controls">
                        <span id="show_upload_message_icoA">                      
							<foreach name="sqfj_arr" item="vo" >
								<div id="file_id_{$vo}">
									<a target="_blank" href="{:U('down_file')}?file_id={$vo}">查看文档</a>
									&nbsp;&nbsp;&nbsp;&nbsp;
									<a href="javascript:del_file({$vo},'icoA')">删除</a>
								</div>
							</foreach>
                        </span>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">其他说明</label>
                    <div class="controls">
                        <textarea class="custom-scroll" row="3" name="qtyq">{$info.qtyq}</textarea>
                    </div>
                </div>
                <div class="form-actions">
               		<input type="hidden" name="id" value="{$info.id}">
                    <button type="submit" class="btn btn-primary">保存</button>
                    <button type="reset" class="btn">返回</button>
                </div>
            </fieldset>
        </form>
    </div>
</block>
<block name="script">
<script type="text/javascript">
    //设置默认属性
    //Think.setValue("pid", {$info.cxyq|default = 0});
    //Think.setValue("hide", {$info.wtdwxz|default = 0});
    //Think.setValue("hide", {$info.xmjb|default = 0});

    var work_arr = ["2015-07-10","2015-07-13","2015-07-14","2015-07-15","2015-07-16","2015-07-17","2015-07-20","2015-07-21","2015-07-22","2015-07-23","2015-07-24","2015-07-27","2015-07-28","2015-07-29","2015-07-30","2015-07-31","2015-08-03","2015-08-04","2015-08-05","2015-08-06"];
    $(document).ready(function() {
        $('#startdate').datepicker({
            dateFormat : 'dd.mm.yy',
            prevText : '<i class="fa fa-chevron-left"></i>',
            nextText : '<i class="fa fa-chevron-right"></i>'
        });
    });
    $("input[name='cxyq']").click(function(){get_lbg_time();})

    function get_lbg_time()
    {
        var v = $('#date_input').val();
        if(v != ''){
            var d_nums=get_days(v);
            var cxyq	=	$("input[name='cxyq']:checked").val();
            if(cxyq == 1){
                if(d_nums>7){
                    $('#sfjj').val('2');
                    $('#sfjj_name').val('不加急 ');

                }else{
                    $('#sfjj').val('1');
                    $('#sfjj_name').val('加急 ');
                }
            }else{
                if(d_nums>15){
                    $('#sfjj').val('2');
                    $('#sfjj_name').val('不加急 ');
                }else{
                    $('#sfjj').val('1');
                    $('#sfjj_name').val('加急 ');
                }
            }
        }
    }
    function get_days(pub){
        var num=0;
        for(i=0;i<work_arr.length;i++)
        {
            num++;
            if(pub == work_arr[i])
            {
                return num;
                break;
            }
        }
        return num;
    }


</script>
</block>